package com.xbongbong.pro.sharepermission.pojo.dto;

import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.pro.knowledge.base.pojo.OptionalRangePojo;
import com.xbongbong.pro.sharepermission.pojo.SharePermissionJointConditionPojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
 * @author 李翔
 * @date 2023/2/27
 * @description
 */
@Getter
@Setter
@ToString
public class SharePermissionSaveDTO extends BaseDTO {

    private static final long serialVersionUID = -2299617108794509953L;

    /**
     * 主键id - 编辑传
     */
    private Long id;
    /**
     * 规则名称
     */
    @NotEmpty(message = "dto.msg.common.name.NotBlank")
    @Size(max = 100, message = "enum.sla.msg.error.ruleNameTooLong")
    private String name;
    /**
     * 共享表单id
     */
    @NotNull(message = "{dto.msg.common.formId.NotNull}")
    private Long formId;
    /**
     * 筛选条件
     */
    @NotNull(message = "{dto.msg.SharePermissionSaveDTO.condition.NotNull}")
    @Valid
    private SharePermissionJointConditionPojo condition;
    /**
     * 授权用户
     */
    @NotNull(message = "{dto.msg.SharePermissionSaveDTO.authority.NotNull}")
    @NotEmpty(message = "{dto.msg.SharePermissionSaveDTO.authority.NotNull}")
    private List<OptionalRangePojo> authority;
    /**
     * 数据权限：1可编辑、0只读
     */
    @NotNull(message = "{dto.msg.SharePermissionSaveDTO.permission.NotNull}")
    private Integer permission;
    /**
     * 应用id
     */
    @NotNull(message = "{dto.msg.common.appId.NotNull}")
    private Long appId;
    /**
     * 应用类型，1为saas应用，2为自建应用
     */
    @NotNull(message = "{dto.msg.common.saasMark.NotNull}")
    private Integer saasMark;
    /**
     * 业务类型
     */
    @NotNull(message = "{dto.msg.common.businessType.NotNull}")
    private Integer businessType;

}
